Check a list is empty or notΒΆ

if not L

Check a list is empty or not.
L = []
if not L:
    print("List is empty")

Output:

List is empty